package cn.snmp.mutual.nms;

import java.io.*;
import java.sql.*;
import java.util.*;

public class SnmpAPI extends Thread implements Serializable
{
    public static final int OTHER = 1;
    public static final int VOLATILE = 2;
    public static final int NONVOLATILE = 3;
    public static final int PERMANENT = 4;
    public static final int READONLY = 5;
    boolean commAuthFlag;
    boolean notifyFilter;
    static final int V1_COMMUNITY_MODEL = 1;
    static final int V2_COMMUNITY_MODEL = 2;
    private boolean tableRegistered;
    static boolean DEBUG;
    boolean threadStop;
    int reqID;
    int msgID;
    int MONITOR_SLEEP;
    static Statement stmt;
    Connection connection;
    boolean v3dBaseFlag;
    boolean v3ConfigFlag;
    String v3ConfigTable;
    static int prevId;
    static int prevmId;
    public static String ENCODING;
    public int SNMP_PORT;
    public int SNMP_TRAP_PORT;
    public static final int SNMP_VERSION_1 = 0;
    public static final int SNMP_VERSION_2C = 1;
    public static final int SNMP_VERSION_2 = 2;
    public static final int SNMP_VERSION_3 = 3;
    public static final byte GET_REQ_MSG = -96;
    public static final byte GETNEXT_REQ_MSG = -95;
    public static final byte GET_RSP_MSG = -94;
    public static final byte SET_REQ_MSG = -93;
    public static final byte TRP_REQ_MSG = -92;
    public static final byte GETBULK_REQ_MSG = -91;
    public static final byte INFORM_REQ_MSG = -90;
    public static final byte TRP2_REQ_MSG = -89;
    public static final byte REPORT_MSG = -88;
    public static final byte SNMP_ERR_NOERROR = 0;
    public static final byte SNMP_ERR_TOOBIG = 1;
    public static final byte SNMP_ERR_NOSUCHNAME = 2;
    public static final byte SNMP_ERR_BADVALUE = 3;
    public static final byte SNMP_ERR_READONLY = 4;
    public static final byte SNMP_ERR_GENERR = 5;
    public static final byte SNMP_ERR_NOACCESS = 6;
    public static final byte SNMP_ERR_WRONGTYPE = 7;
    public static final byte SNMP_ERR_WRONGLENGTH = 8;
    public static final byte SNMP_ERR_WRONGENCODING = 9;
    public static final byte SNMP_ERR_WRONGVALUE = 10;
    public static final byte SNMP_ERR_NOCREATION = 11;
    public static final byte SNMP_ERR_INCONSISTENTVALUE = 12;
    public static final byte SNMP_ERR_RESOURCEUNAVAILABLE = 13;
    public static final byte SNMP_ERR_COMMITFAILED = 14;
    public static final byte SNMP_ERR_UNDOFAILED = 15;
    public static final byte SNMP_ERR_AUTHORIZATIONERROR = 16;
    public static final byte SNMP_ERR_NOTWRITABLE = 17;
    public static final byte SNMP_ERR_INCONSISTENTNAME = 18;
    public static final byte INTEGER = 2;
    public static final byte STRING = 4;
    public static final byte BITSTRING = 3;
    public static final byte OBJID = 6;
    public static final byte NULLOBJ = 5;
    public static final byte IPADDRESS = 64;
    public static final byte NETWORKADDRESS = 64;
    public static final byte COUNTER = 65;
    public static final byte GAUGE = 66;
    public static final byte UNSIGNED32 = 66;
    public static final byte TIMETICKS = 67;
    public static final byte OPAQUE = 68;
    public static final byte UINTEGER32 = 71;
    public static final byte NSAP = 69;
    public static final byte COUNTER64 = 70;
    public static final byte NOSUCHOBJECTEXP = Byte.MIN_VALUE;
    public static final byte NOSUCHINSTANCEEXP = -127;
    public static final byte ENDOFMIBVIEWEXP = -126;
    static int SID_MAX_LEN;
    static int MAX_NAME_LEN;
    public static final int RONLY = 43690;
    public static final int WONLY = 43691;
    public static final int RWRITE = 43706;
    public static final int NOACCESS = 0;
    public static final int RCREATE = 43708;
    public static final int ACCESSFORNOTIFY = 1;
    public static String Standard_Prefix;
    static final int USM_SECURITY_MODEL = 3;
    byte[] snmpEngineID;
    int snmpEngineBoots;
    int snmpEngineTime;
    long startTime;
    int timeWindow;
    private static final String HEADER = "#";
    String providerFileName;
    static Hashtable snmpGroupTable;
    String serializeFileName;
    String engineBootsSerializeFileName;
    public static final int ACTIVE = 1;
    public static final int NOT_IN_SERVICE = 2;
    public static final int NOT_READY = 3;
    public static final int CREATE_AND_GO = 4;
    public static final int CREATE_AND_WAIT = 5;
    public static final int DESTROY = 6;
    public static final int ANY_SEC_MODEL = 0;
    public static final int FATAL = 1;
    public static final int CRITICAL = 2;
    public static final int NON_CRITICAL = 3;
    static final int METHOD_TRACE = 7;
    static final int MESSAGE_TRACE = 8;
    static boolean setupStdOutErrDone;
    public static int debugLevel;
    
    public static boolean compare(final int[] src, final int[] dest) {
        if (src == null || dest == null) {
            return false;
        }
        final int i = src.length;
        final int j = dest.length;
        if (i != j) {
            return false;
        }
        int k = 0;
        while (k < i) {
            if (src[k] != dest[k++]) {
                return false;
            }
        }
        return true;
    }
    
    static {
        SnmpAPI.DEBUG = false;
        SnmpAPI.stmt = null;
        SnmpAPI.prevId = 0;
        SnmpAPI.prevmId = 0;
        SnmpAPI.ENCODING = "ISO8859_1";
        SnmpAPI.SID_MAX_LEN = 64;
        SnmpAPI.MAX_NAME_LEN = 64;
        SnmpAPI.Standard_Prefix = ".1.3.6.1.2.1.";
        SnmpAPI.snmpGroupTable = new Hashtable();
        SnmpAPI.setupStdOutErrDone = false;
        SnmpAPI.debugLevel = 1;
    }
}
